#include <stdio.h>
#include <stdlib.h>

typedef char ElementType;
typedef struct TNode *Position;
typedef Position BinTree;
struct TNode{
    ElementType Data;
    BinTree Left;
    BinTree Right;
};

BinTree CreatBinTree(); /* 实现细节忽略 */
int GetHeight( BinTree BT );

int main()
{
    BinTree BT = CreatBinTree();
    printf("%d\n", GetHeight(BT));
    return 0;
}
int GetHeight(BinTree BT){
    int left=0,right=0;
    if(!BT){
        return 0;
    }
    if(BT&&!BT->Left&&!BT->Right){
        return 1;
    }
    left = GetHeight(BT->Left);
    right = GetHeight(BT->Right);
    return left>right? left+1:right+1;
}
